package com.wang.web3.data.service;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

/**
 * @author Mr.Wang
 * @version 1.0
 * @time 2016/8/22-13:09
 * @describe  * 说明：统一回调实体
 * ｛"status":"0"成功，“1”失败,"message":"","resObj":obj｝
 */
public class CallBackVo {

    String msg;
    String error;
    int code;
    Object result;


    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public String getMessage() {
        return msg;
    }

    public void setMessage(String message) {
        this.msg = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        Gson mGson = new Gson();
        ResultBean resultBean = mGson.fromJson(mGson.toJsonTree(result), new TypeToken<ResultBean>() {}.getType());
        return resultBean.getData().getData();
    }

    public Object getDataX() {
        Gson mGson = new Gson();
        ResultBeanX resultBean = mGson.fromJson(mGson.toJsonTree(result), new TypeToken<ResultBeanX>() {}.getType());
        return resultBean.getData();
    }


    public Object getResult() {
        return result;
    }

    public void setResult(ResultBean result) {
        this.result = result;
    }

    public static class ResultBean {

        private DataBeanX data;
        private Object meta;

        public Object getMeta() {
            return meta;
        }

        public void setMeta(Object meta) {
            this.meta = meta;
        }

        public DataBeanX getData() {
            return data;
        }

        public void setData(DataBeanX data) {
            this.data = data;
        }


        public static class DataBeanX {

            private Object data;

            public Object getData() {
                return data;
            }

            public void setData(Object data) {
                this.data = data;
            }
        }
    }
    public static class ResultBeanX {

        private Object data;

        public Object getData() {
            return data;
        }

        public void setData(Object data) {
            this.data = data;
        }
    }
}
